package com.hpeng.sys.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.hpeng.sys.service.LoginUserMgr;
import com.hpeng.sys.service.impl.LoginUserMgrImpl;

public class GetUerInfoAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5703133265247588257L;
	String userDeparName;
	Boolean userIsJBR;
	String userTemName;
	@Resource
	private LoginUserMgr loginUser;
	@Override
	public String execute() throws Exception {
			HttpServletRequest  request=ServletActionContext.getRequest();
			
			userDeparName=loginUser.getUserDeptName(request);
			userIsJBR=loginUser.isJBR(request);
			userTemName=loginUser.getUserTemplateName(request);
			
//			System.out.println("------------------------------");
//			System.out.println(userTemName);
//			System.out.println(userIsJBR);
//			System.out.println(userDeparName);
//			System.out.println("------------------------------");
			
			
			
			if (userTemName.equals("系统管理员")||userTemName.equals("分管局领导")) {
				return SUCCESS;
			}else if (userDeparName.equals("物资部")&&userIsJBR==true) {
				return SUCCESS;
			}else {
				return NONE;
			}

		
	}
	
	
	

	
	
	
	
}
